I have this pretty simple code:
static void Main(string[] args)
{
int i, pcm, maxm = 0, minm = 0;
for (i = 1; i <= 3; i++)
{
if (pcm > maxm)
maxm = pcm;
Console.WriteLine("Please enter your computer marks");
pcm = int.Parse(Console.ReadLine());
}
Console.ReadKey();
}
As you can see I have the var pcm and maxm(maximum value), to find the maximum value I got this code : if (pcm > maxm) maxm = pcm;, I would like to get the minm(minimum value) in the same way I got the maxim(maximum value). how could I do that?
Madam Walker
05-Oct-2013Do it the same way you are doing max